package speedball;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.shape.SVGPath;
import javafx.scene.shape.Shape;
import javafx.stage.Stage;

public class GameModeTest extends Application{

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        Shape ring= ShapeManage.createRing(100,100,40,15);

//        ring.
        SVGPath svg = new SVGPath();
//        svg.setContent("M40,60 C42,48 44,30 25,32");

//        svg.setContent("M 289.00,74.00 C 299.18,61.21 307.32,52.80 320.00,42.42 331.43,33.07 343.66,26.03 357.00,19.84 427.64,-12.98 509.92,2.91 564.42,58.28 583.93,78.10 595.94,99.15 605.58,125.00 607.76,130.86 611.37,144.75 612.54,151.00 613.15,154.23 613.28,160.06 615.58,162.44 617.49,164.42 624.11,165.84 627.00,166.86 634.80,169.62 639.97,172.04 647.00,176.42 673.69,193.07 692.76,221.39 695.83,253.00 700.60,302.03 676.64,345.41 630.00,364.00 621.17,367.52 608.48,370.99 599.00,371.00 599.00,371.00 106.00,371.00 106.00,371.00 96.50,370.99 87.00,368.97 78.00,366.00 36.29,352.22 6.21,312.25 6.00,268.00 5.77,219.90 34.76,179.34 81.00,165.02 96.78,160.14 107.02,161.00 123.00,161.00 124.59,150.68 130.49,137.79 136.05,129.00 150.70,105.88 173.22,88.99 200.00,82.65 213.13,79.55 219.79,79.85 233.00,80.00 247.37,80.17 264.61,85.94 277.00,93.00 279.11,86.37 284.67,79.45 289.00,74.00 Z");
//        svg.setContent("M 289.00,74.00 C 299.18,61.21 307.32,52.80 320.00,42.42 331.43,42.42 331.43,33.07 343.66,26.03 357.00,19.84 427.64,-12.98 509.92,2.91 564.42,58.28 583.93,78.10 595.94,99.15 605.58,125.00 607.76,130.86 611.37,144.75 612.54,151.00 613.15,154.23 613.28,160.06 615.58,162.44 617.49,164.42 624.11,165.84 627.00,166.86 634.80,169.62 639.97,172.04 647.00,176.42 673.69,193.07 692.76,221.39 695.83,253.00 700.60,302.03 676.64,345.41 630.00,364.00 621.17,367.52 608.48,370.99 599.00,371.00 599.00,371.00 106.00,371.00 106.00,371.00 96.50,370.99 87.00,368.97 78.00,366.00 36.29,352.22 6.21,312.25 6.00,268.00 5.77,219.90 34.76,179.34 81.00,165.02 96.78,160.14 107.02,161.00 123.00,161.00 124.59,150.68 130.49,137.79 136.05,129.00 150.70,105.88 173.22,88.99 200.00,82.65 213.13,79.55 219.79,79.85 233.00,80.00 247.37,80.17 264.61,85.94 277.00,93.00 279.11,86.37 284.67,79.45 289.00,74.00 Z");

//        svg.setContent("M 289.00,74.00 C 299.18,61.21 307.32,52.80 320.00,400.00");


        double midX=600.00D;
        double midY=100.00D;
        double minwidth=60.00D;
        double minHeight=20.00D;
        double minOffsetHeight =5.00D;


        double maxwidth=80.00D;
        double maxHeight=25.00D;
        double temp=5.00D;
        double maxOffsetHeight =15.00D;

        StringBuffer stringBuffer=new StringBuffer();
//        stringBuffer.append("M ").append(midX-minwidth/2).append(",").append(midY-minOffsetHeight).append(" ");
//        stringBuffer.append("C ").append(midX-minwidth/2).append(",").append(midY-minOffsetHeight).append(" ").append(midX).append(",").append(midY-minHeight).append(" ").append(midX+minwidth/2).append(",").append(midY-minOffsetHeight).append(" ");
//
//        stringBuffer.append("L ").append(midX+minwidth/2-temp).append(",").append(midY).append(" ");
//        stringBuffer.append("L ").append(midX+maxwidth/2).append(",").append(midY+maxOffsetHeight).append(" ");
//
//        stringBuffer.append("C ").append(midX+maxwidth/2).append(",").append(midY+maxOffsetHeight).append(" ").append(midX).append(",").append(midY+maxOffsetHeight-maxHeight).append(" ").append(midX-maxwidth/2).append(",").append(midY+maxOffsetHeight).append(" ");
//
//        stringBuffer.append("L ").append(midX-maxwidth/2).append(",").append(midY+maxOffsetHeight).append(" ");
//        stringBuffer.append("L ").append(midX-minwidth/2+temp).append(",").append(midY).append(" ");
//
//        stringBuffer.append("Z ");
//
        stringBuffer.append("M ").append(0).append(",").append(0).append(" ");
        stringBuffer.append("C ").append(100).append(",").append(200).append(" ").append(150).append(",").append(150).append(" ").append(100).append(",").append(200).append(" ");

        stringBuffer.append("Z");



//        stringBuffer.append("L ").append(midX-minwidth/2).append(",").append(midY).append(" ");
        svg.setContent(stringBuffer.toString());
//        svg.setContent("M 300.00,60.00  C 300.00,60.00 320.00,50.00 340.00,60.00 L 338.00,65.00 L 345.00,75.00 C 345.00,75.00 320.00,65.00 290.00,75.00 L 305.00,65.00 L 300.00,60.00");
        //M 289.00,74.00

//        svg.setContent("M40,60 C42,48 44,30 25,32");


//        ring.

        Group group=new Group();group.getChildren().addAll(ring,svg);



        Scene scene=new Scene(group);

        primaryStage.setScene(scene);
        primaryStage.show();


















    }
}
